package com.team1.Test;
import java.sql.Timestamp;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.team1.manager.classes.entity.Classes;
import com.team1.manager.group.entity.Group;
import com.team1.manager.role.entity.Role;
import com.team1.manager.school.entity.School;
import com.team1.manager.student.entity.Student;
import com.team1.manager.student.service.StudentService;

public class TestStudent {
	private ApplicationContext ac;

	@Before
	public void getApplicationContext() {
		ac = new ClassPathXmlApplicationContext("applicationContext.xml");
	}

	@Test
	public void testSave() {
		/*Student(String id, String sNO, String sName, String sPassWord,
				boolean sGender, Integer sIntegral, Integer sLeCurrency,
				String seamil, Timestamp sEnrollmentDate, Timestamp sBirthDay,
				Timestamp sLastLoginDate, String sNation, String sHighSchool,
				String sAddress, String sPhoneNumber, String sQQ, String sIDCard,
				boolean enexamination, Role role, Classes classes, School school,
				Group group)*/
		Classes classes = new Classes();
		classes.setName("教育技术学2012");
		
		Student student = new Student(null, "201227140128","叶问","123456",true,1000,1000,"2360820596@qq.com",Timestamp.valueOf("2012-09-08 10:29:30"),
				Timestamp.valueOf("2012-09-08 10:29:30"),Timestamp.valueOf("2012-09-08 10:29:30"),"汉族","重阳","湖北","15827484367",
				"2360820596","412131231234214123312",true,null,classes,null,null
				);
		StudentService studentService = (StudentService) ac.getBean("studentService");
		studentService.save(student);
		System.out.println("");
	}

	@Test
	public void testDelete() {

	}
}
